﻿// See https://aka.ms/new-console-template for more information
using EasyNetQ;
using RabbitMessage;

Console.WriteLine("Hello, World!");

// host=192.168.1.1;port=5672;virtualHost=MyVirtualHost;username=MyUsername;password=MyPassword;requestedHeartbeat=10
using (var bus = RabbitHutch.CreateBus("host=192.168.95.11;port=5672;virtualHost=cap-vhost;username=cap;password=cap123456", s => s.EnableSystemTextJson()))
{
    var input = String.Empty;
    Console.WriteLine("Enter a message. 'Quit' to quit.");
    while ((input = Console.ReadLine()) != "Quit")
    {
        bus.PubSub.Publish(new TextMessage { Text = input },"OrderMessage");
        Console.WriteLine("Message published!");
    }
}